#define _CRT_SECURE_NO_WARNINGS 
#include <stdio.h>
#define N 10
void fun(int a[N][N], int n);
int main()
{
    int a[N][N];
    int i, j, n;
    scanf("%d", &n);
    fun(a, n);
    for (i = 0; i < n; i++)
    {
        for (j = 0; j <= i; j++)
            printf("%d ", a[i][j]);
        printf("\n");
    }
    return 0;
}

void fun(int a[N][N], int n)
{
    for (int i = 0; i < n; i++)
    {
        a[i][0] = 1;
        a[i][i] = 1;
    }
    if (n >= 3)
    {
        for (int i = 2; i < n; i++)
        {
            for (int k = 1; k < i; k++)
            {
                a[i][k] = a[i - 1][k - 1] + a[i - 1][k];
            }
        }
    }
}